// 菜单
import request from '@/axios';
import {baseUrl} from '@/config/env';
import baseService from "../../crud/baseService";

export const menuList = (data) => {
    return request({
        url: baseUrl + '/crud/list',
        method: 'get',
        meta: {
            isSerialize: true
        },
        params: data
    })
}


// 菜单树形展示
export const menuTree = (lazy, parentId) => {
    let param = {
        lazy: lazy,
        parentId: parentId
    }
    return baseService.postData('/system/sysMenu/tree', param)
}

// 新增菜单
export const saveMenu = (param) => {
    return baseService.postJsonData('/system/sysMenu/', param)
}

// 修改

export const updateMenu = (param) => {
    return baseService.putData('/system/sysMenu/', param)
}
// 删除
export const deleteMenu = (id) => {
    return baseService.deleteData('/system/sysMenu/' + id)
}


